<div class="cbac">
  <h1>Memberships</h1>
  <table>
    <tr>
      <th class="medium">Users</th>
      <% @generic_roles.each do |role| %>
        <th><%= role.name %></th>
      <% end %>
    </tr>
    <% (@users.sort do |x,y| x.name.downcase <=> y.name.downcase end).each do |u| %>
      <tr>
<%- # TODO: documentation must contain something on users having the 'name' method/ field %>
        <td><%= u.name %></td>
        <% @generic_roles.each do |generic_role| %>
          <td class="checked">
            <%= render :partial => "cbac/memberships/update.html", :locals => {:generic_role => generic_role,
              :user_id => u.id.to_s,:update_partial => false} %>
          </td>
        <% end %>
      </tr>
    <% end %>
  </table>
</div>
